//
//  InputPhoneView.swift
//  Box
//
//  Created by mn on 2025/3/31.
//

import UIKit
import SnapKit

class InputPhoneView: UIView {
    
    private let loginTipView = LoginTipView()

    let phoneTextField: UITextField = {
        let textField = UITextField()
        textField.keyboardType = .numberPad
        textField.textAlignment = .center
        textField.font = .systemFont(ofSize: 24,weight: .bold)
        textField.borderStyle = .none
        textField.backgroundColor = .white.withAlphaComponent(0.1)
        textField.textColor = .white
        #if DEBUG
            textField.text = "15215045168"
        #endif
        return textField
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupView()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupView()
    }
    
    private func setupView() {
        addSubview(loginTipView)
        loginTipView.textLabel.text = "请输入手机号码"
        addSubview(phoneTextField)

        loginTipView.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(20)
            make.centerX.equalToSuperview()
        }

        phoneTextField.snp.makeConstraints { make in
            make.top.equalTo(loginTipView.snp.bottom).offset(48)
            make.left.right.equalToSuperview().inset(21)
            make.height.equalTo(52)
        }
    }
}
